-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[embind] Add pointer policies for val's call, operator(), and new_. #24832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
reviewer: The first commit is just moving policy code into wire.h, so it's probably easier to look at the second commit on its own. |
84962cb
to
1c165b0
Compare
@sbc or @RReverser mind taking a look? The changes ignorning the moved code are relatively small 01eafbe |
So does this mean some code now will not work of behave differently under C++11 vs C++17? I wonder if we should document this or mention in the changelog? |
system/include/emscripten/val.h
Outdated
using Policy = WithPolicies<FilterTypes<isPolicy, Args...>>; | ||
auto filteredArgs = Filter<isNotPolicy>(args...); | ||
return std::apply( | ||
[&](auto&&... filteredArgs) -> decltype(auto) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we name filteredArgs
differently here so it doesn't shadow the outer filteredArgs
2 lines up?
…w_`. After emscripten-core#24175, pointer policies were required in more places, but there was no way to pass the policy into val's `call`, `operator()`, and `new_` methods and use pointers. All of these methods take variadic template arguments already which made passing separate variadic policy arguments challenging. I used some C++14/17 tricks to separate the regular arguments and policy arguments.
1c165b0
to
793d255
Compare
After #24175, pointer policies were required in more places, but there
was no way to pass the policy into val's
call
,operator()
, andnew_
methods and use pointers.
All of these methods take variadic template arguments already
which made passing separate variadic policy arguments challenging. I used
some C++14/17 tricks to separate the regular arguments and policy
arguments.
Fixes #24398